<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <i>  </i>
</body>
<script type="text/javascript">
  var a = [{'card_id':123,'card_ext':"小明"},{'card_id':456,'card_ext':"小红"},{'card_id':789,'card_ext':"小王"}];
  // for(var i=0;i<a.length;i++){
  //   a[i].cardID = a[i].card_id;
  //   a[i].cardExt = a[i].card_ext;
  //   delete a[i].card_id;
  //   delete a[i].card_ext;
  // }
  // console.log(a);
  var A = {};
  var b = [];
  for(let i=0;i<a.length;i++){
    A.cardID = a[i].card_id;
    A.cardExt = a[i].card_ext;
    b.push(A);
    A={};//这一步一定不可以少,否则最后一步会覆盖前面的,最后的b数组只会是最后一个;
  }
  console.log(b);
//========================================
var key = 'abc';
var obj = {key : '值'}; 

// 复制原来的值
obj[key] = obj['key'];
// 删除原来的键
delete obj['key'];
// 检查效果
console.log(obj);
// 以上。请采纳，请给分。

</script>
</html>
